#include<stdio.h>
#define L 20
struct teachers
{
	char name[L]; 
	int k;
	int age;
};
int main(void)
{
	int n,i;
	scanf("%d",&n);
	struct teachers a[1000];
	for(i=0;i<n;i++)
	{
		scanf("%s%d%d",&a[i].name,&a[i].k,&a[i].age);
	}
	n=n/2;
	if(a[n].k==0)
	{
		printf("%s Female %d",a[n].name,a[n].age);
	}
	else
	{
		printf("%s Male %d",a[n].name,a[n].age);
	}
	return 0;
}
